# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import otherOperationConstants
from .databaseOperation import databaseOperationSubDirectiveTree
from .PDFFileOperation import PDFFileOperationSubDirectiveTree
from .exceptionHandler import exceptionHandlerSubDirectiveTree

class OtherOperationSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(OtherOperationSubDirectiveTree, self).__init__(parent)
        self.createOtherOperationTreeNode()

    def createOtherOperationTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "otherOperation"
        self.setText(0,"其它操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, otherOperationConstants.OtherOperationConstants.printingLogDirective, "打印日志")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, otherOperationConstants.OtherOperationConstants.exportingLogDirective, "导出日志")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, otherOperationConstants.OtherOperationConstants.insertingCodeSegmentDirective, "插入代码段(Python)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, otherOperationConstants.OtherOperationConstants.addingCommentDirective, "添加备注说明")
        databaseOperationSubDirectiveTree.DatabaseOPerationSubDirectiveTree(self) #挂载数据库操作子节点
        PDFFileOperationSubDirectiveTree.PDFFileOperationSubDirectiveTree(self) #挂载PDF文件操作子节点
        exceptionHandlerSubDirectiveTree.ExceptionHandlerSubDirectiveTree(self) #挂载异常处理子节点
